<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/add.css"/>
	</head>
	<body>
		<div id="app">
			<div class="header">
				<span>删除快递信息</span>
			</div>
			<div class="content">
				<table>	
					<tr>
						<td class="text-right">运单号</td><td class="content_right"><input id="number-by" class="input inline-input" placeholder="请输入运单号码"> <span id="find" class="btn btn-info">立即查找</span></td>
					</tr>
				</table>
			</div>
			
			
			<div class="header">
				<span>查找信息如下</span>
			</div>
			<div class="content">
				<table>
					<tr>
						<td class="text-right">快递单号</td><td class="content_right"><input id="number" class="input" placeholder="请输入快递单号" disabled></td>
					</tr>
					<tr>
						<td class="text-right">快递公司</td><td class="content_right"><input id="company" class="input" placeholder="请输入快递公司" disabled></td>
					</tr>
					<tr>
						<td class="text-right">收货人姓名</td><td class="content_right"><input id="receiveName" class="input" placeholder="请输入姓名" disabled></td>
					</tr>
					<tr>
						<td class="text-right">手机号码</td><td class="content_right"><input id="receivePhone" class="input" placeholder="请输入手机号码" disabled></td>
					</tr>
					<tr>
						<td class="text-right">快递状态</td><td class="content_right"><span id="status"></span></td>
					</tr>
					<tr>
						<td></td><td class="content_right"><span id="delete" class="btn btn-info">立即删除</span><!-- <span class="btn">重置</span> </td>-->
					</tr>
				</table>
			</div>
		</div>
	</body>
	<script src="../../qrcode/jquery2.1.4.js"></script>
	<script src="../../assets/layui.all.js"></script>

	<script>
		$(".header:eq(1),.content:eq(1)").hide();
		$(function () {
			$("#find").click(function () {
				$(".header:eq(1),.content:eq(1)").hide();
				var number_by = $("#number-by").val();
				if(number_by==='' || number_by==null){
					layer.msg("单号不能为空！");
					return false;
				}
				var windowId = layer.load()
				$.post("/express/findByNumber.do",{number:number_by},function (data) {
					layer.close(windowId);
					layer.msg(data.result);
					if(data.status===1){
						$("#company").val(data.data.company);
						$("#number").val(data.data.number);
						$("#receivePhone").val(data.data.receivePhone);
						$("#receiveName").val(data.data.receiveName);
						if(data.data.status===1){
							$("#status").html("已签收");
						} else {
							$("#status").html("未签收");
						}
						$(".header:eq(1),.content:eq(1)").fadeIn(1000);
					}

				})
			})
			$("#delete").click(function () {
				var windowId = layer.load();
				var number = $("#number").val();
				$.post("/express/delete.do",{number:number},function (data) {
					layer.close(windowId);
					layer.msg(data.result);
					if(data.status === 1){
						//删除成功
						$(".header:eq(1),.content:eq(1)").hide();
						id = null;
						phone = null;
						$("#company").val("顺丰快递")
						$("#number").val("")
						$("#receivePhone").val("")
						$("#receiveName").val("")
					}
				})
			})
		})
	</script>
</html>
